/*
 *  This file is part of Bracket Security
 *  Copyright 2011-2013 David R. Smith
 *
 */
package asia.redact.bracket.security;

import asia.redact.bracket.util.SafeString;

/**
 * Output from encryption process
 * 
 * @author Dave
 *
 */
public class EncryptResult {

	public final SafeString armoredKey;
	public final SafeString armoredMessage;
	
	public EncryptResult(SafeString armoredKey, SafeString armoredMessage) {
		super();
		this.armoredKey = armoredKey;
		this.armoredMessage = armoredMessage;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((armoredKey == null) ? 0 : armoredKey.hashCode());
		result = prime * result
				+ ((armoredMessage == null) ? 0 : armoredMessage.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}
		if (obj == null) {
			return false;
		}
		if (!(obj instanceof EncryptResult)) {
			return false;
		}
		EncryptResult other = (EncryptResult) obj;
		if (armoredKey == null) {
			if (other.armoredKey != null) {
				return false;
			}
		} else if (!armoredKey.equals(other.armoredKey)) {
			return false;
		}
		if (armoredMessage == null) {
			if (other.armoredMessage != null) {
				return false;
			}
		} else if (!armoredMessage.equals(other.armoredMessage)) {
			return false;
		}
		return true;
	}
	
	
}
